package com.xhwl.logistics.service.cent;

import com.xhwl.common.dto.cent.sdata.OrganizationDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.Account;
import com.xhwl.common.pojo.cent.sdata.Organization;
import com.xhwl.common.query.cent.sdata.OrganizationQuery;
import feign.Param;
import feign.RequestLine;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Lu.Aaron
 * @since 2021-04-06
 */
//@FeignClient(value = "cent-data-core")
public interface IOrganizationService {

    /**
     * 通过主键id查找 组织
     * @param id
     * @return
     */
    @RequestLine(value = "POST /organization-service/get-by-id")
    Organization getById(@Param("id") Integer id);

    /**
     * 创建组织
     *
     * @param organization
     * @return
     */
    @RequestLine(value = "POST /organization-service/create")
    ResultJson create(@Param("organization")Organization organization, @Param("account")Account account);
    /**
     * 批量创建组织
     *
     */
    @RequestLine(value = "POST /organization-service/batch-create")
    ResultJson create(@Param("organizationList") List<Organization> organizationList, @Param("account") Account account);


    /**
     * 删除组织
     *
     * @param id
     */
    @RequestLine(value = "POST /organization-service/delete")
    ResultJson delete(@Param("id")Integer id, @Param("account") Account account);

    /**
     * 删除节点,包含子节点
     * @param id
     * @return
     */
    @RequestLine(value = "POST /organization-service/delete-follow")
    ResultJson deleteFollow(@Param("id") Integer id);


    @RequestLine(value = "POST /organization-service/batch-delete")
    ResultJson batchDelete(@Param("ids")  List<Integer> ids);

    /**
     * 修改组织
     *
     * @param organization
     */
    @RequestLine(value = "POST /organization-service/update")
    ResultJson update(@Param("organization") Organization organization, @Param("account") Account account);

    /**
     * 查询组织树
     *
     * @return
     */
    @RequestLine(value = "POST /organization-service/tree")
    List<OrganizationDTO> tree(@Param("organizationQuery") OrganizationQuery organizationQuery);

    /**
     * 查询组织列表
     *
     * @param organizationQuery
     * @return
     */
    @RequestLine(value = "POST /organization-service/list")
    List<Organization> list(@Param("organizationQuery") OrganizationQuery organizationQuery);

    @RequestLine(value = "POST /organization-service/find")
    Organization find(@Param("organizationQuery") OrganizationQuery organizationQuery);

    /**
     * 获取空间的信息
     */
    @RequestLine(value = "GET /space/detail")
    ResultJson detail(@Param("id") Integer id, @Param("orgId") Integer orgId);
}
